package com.yutian.example.demo.common.model;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

@Data
public class PageBaseRequestDO {

    /**
     * 偏移量 = pageNumber * pageSize 必填
     * 注：从0开始
     */
    private Long offset;

    /**
     * 获取数目 必填
     */
    private Integer pageSize;

    /**
     * 格式: id asc, name desc
     */
    private String sortSql = " id DESC ";

    public void setSortSql(String sortSql) {
        if(StringUtils.isBlank(sortSql)){
            this.sortSql = " id DESC ";
        }
        this.sortSql = sortSql;
    }
}
